package GUI;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.*;

/**
 *@author Juan Alapin - 324507516
 *@author Giora Yaffe - 036551281
 *@author Shachar Gritzman - 300174026
 *@author Nir Porat - 021515580
*/

public class IS_dep_manager extends MasterGUI{
	
	
	private static final long serialVersionUID = 1L;
	private MainGUI mainGui;
	private JButton btnUDefrostProcess;
	private JButton btnDetermineSupervivor;
	private JButton btnDetermineCommittee;
	private JButton btnShowWorkers;
	private JButton btnActivityReports;
	private JPanel panel_1;
	private JButton btnShowRequests,PrefRep;

	
	public IS_dep_manager(MainGUI mainGui){
		
		super(mainGui);
		this.mainGui=mainGui;		
		panel_1 = new JPanel();
		panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));
		panel_1.setBounds(0, 40, 193, 282);
		getContentPane().add(panel_1);
		panel_1.setLayout(null);
		setBtnUDefrostProcess( );
		setBtnDetermineSupervivor( );
		setBtnReceiveData();
		setBtnStatisticsData( );
		setBtnShowRequests();
		setBtnPrefReports();


		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 884, 40);
		getContentPane().add(panel);
		
		JLabel lblIsDepartmentManagar = new JLabel("IS Department Managar Menu");
		lblIsDepartmentManagar.setFont(new Font("Dialog", Font.BOLD, 16));
		panel.add(lblIsDepartmentManagar);
		
		setBtnDetermineCommittee();
	}

	
	public JButton getBtnUDefrostProcess() {
		return btnUDefrostProcess;
	}

	public void setBtnUDefrostProcess() {
		btnUDefrostProcess = new JButton("Defrost Process");
		btnUDefrostProcess.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				DefrostProcess DP = new DefrostProcess(mainGui);
				DP.setVisible(true);
			}
		});
		btnUDefrostProcess.setBounds(10, 11, 173, 23);
		panel_1.add(btnUDefrostProcess);
	}

	public JButton getBtnDetermineSupervivor() {
		return btnDetermineSupervivor;
	}

	public void setBtnDetermineSupervivor() {
		btnDetermineSupervivor = new JButton("Determine Supervivor");
		btnDetermineSupervivor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				DetermineSupervisor DS = new DetermineSupervisor( mainGui);
				DS.setVisible(true);
			}
		});
		btnDetermineSupervivor.setBounds(10, 45, 173, 23);
		panel_1.add(btnDetermineSupervivor);
	}

	public JButton getBtnDetermineCommittee() {
		return btnDetermineCommittee;
	}

	public void setBtnDetermineCommittee() {
		btnDetermineCommittee = new JButton("Determine Committee");
		btnDetermineCommittee.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				DetermineCommittee DC = new DetermineCommittee(mainGui);
				DC.setVisible(true);
			}
		});
		btnDetermineCommittee.setBounds(10, 79, 173, 23);
		panel_1.add(btnDetermineCommittee);
		
		JButton btnLateRep = new JButton("Latency Report");
		btnLateRep.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				close();
				LatencyReport LR = new LatencyReport(mainGui);
				LR.setVisible(true);	
			}
		});
		btnLateRep.setBounds(10, 248, 173, 23);
		panel_1.add(btnLateRep);
			
		

	}

	public JButton getBtnReceiveData() {
		return btnShowWorkers;
	}

	public void setBtnReceiveData() {
		btnShowWorkers = new JButton("Show Workers");
		btnShowWorkers.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				ShowAllWorkers SAW = new ShowAllWorkers( mainGui);
				SAW.setVisible(true);
			}
		});
		btnShowWorkers.setBounds(10, 113, 173, 23);
		panel_1.add(btnShowWorkers);
	}
	public JButton getBtnPrefReports() {
		return PrefRep;
	}
	public void setBtnPrefReports(){ 
		PrefRep = new JButton("Performance Reports");
		PrefRep.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				Performance PR = new Performance( mainGui);
				PR.setVisible(true);
			}
	});
		PrefRep.setBounds(10, 215, 173, 23);
		panel_1.add(PrefRep);
	}

	public JButton getBtnStatisticsData() {
		return btnActivityReports;
	}

	public void setBtnStatisticsData() {
		btnActivityReports = new JButton("Activity Reports");
		btnActivityReports.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				ActivityReport AReport = new ActivityReport(mainGui);
				AReport.setVisible(true);
			}
		});
		btnActivityReports.setBounds(10, 181, 173, 23);
		panel_1.add(btnActivityReports);
	}

	/**
	 * 
	 * @return MainGUI
	 */
	private MainGUI getmyMainGui(){
		return(mainGui);
	}
	

	public JButton getBtnShowRequests() {
		return btnShowRequests;
	}

	public void setBtnShowRequests() {
		btnShowRequests = new JButton("Show Requests");
		btnShowRequests.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				close();
				ShowAllRequests SAR = new ShowAllRequests(mainGui);
				SAR.setVisible(true);
			}
		});
		btnShowRequests.setBounds(10, 147, 173, 23);
		panel_1.add(btnShowRequests);
	}	
}
